package ca.magex.gps.entity.impl;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import ca.magex.gps.entity.Lap;
import ca.magex.gps.entity.Track;
import ca.magex.gps.entity.Trackpoint;

public class GarminTrack extends TrackpointContainerImpl implements Track {

	private String tags;
	
	private List<Lap> laps;

	public GarminTrack() {
		this.tags = "";
		this.laps = new ArrayList<Lap>();
	}
	
	public String getTags() {
		return tags;
	}

	public void setTags(String tags) {
		this.tags = tags;
	}

	public List<Lap> getLaps() {
		return laps;
	}

	public void setLaps(List<Lap> laps) {
		this.laps = laps;
	}
	
	public void addLap(Lap lap) {
		laps.add(lap);
		for (Trackpoint tp : lap.getTrackpoints()) {
			addTrackpoint(tp);
		}
	}
	
	public Date getStartTime() {
		return ((LapImpl)laps.get(0)).getStart();
	}
	
	public int getNumberOfLaps() {
		return laps.size();
	}
	
}
